/*
 * Copyright (C) 2004, Velocityme Partnership
 * PersonTimeActionForm.java
 *
 * Created on 30 August 2004, 01:30
 */

package com.velocityme.www.actionforms;

import java.util.Calendar;
import java.util.Date;

import org.apache.struts.action.*;

/**
 *
 * @author  Robert
 */
public class PersonTimeActionForm extends ActionForm {
    
    private int m_nodeId;
    private FormDate m_date = new FormDate();
    
    /** Creates a new instance of PersonTimeActionForm */
    public PersonTimeActionForm() {
    }
    
    private class FormDate {
        private int m_year;
        private int m_month;
        private int m_day;
        
        public Date getDate() {
            Calendar date = Calendar.getInstance();
            date.clear();
            date.set(m_year, m_month, m_day);
            return date.getTime();
        }
        
        public void setDate(Date date) {
            Calendar calendar = Calendar.getInstance();
            calendar.setTime(date);
            m_year = calendar.get(Calendar.YEAR);
            m_month = calendar.get(Calendar.MONTH);
            m_day = calendar.get(Calendar.DATE);
        }
        
        public int getYear() { return m_year; }
        public void setYear(int year) { m_year = year; }
        public int getMonth() { return m_month; }
        public void setMonth(int month) { m_month = month; }
        public int getDay() { return m_day; }
        public void setDay(int day) { m_day = day; }
    }
    
    public void reset(ActionMapping mapping, javax.servlet.http.HttpServletRequest request) {
    }
    
    public int getNodeId() {
        return m_nodeId;
    }
    
    public void setNodeId(int nodeId) {
        m_nodeId = nodeId;
    }
    
    public int getYear() { return m_date.getYear(); }
    
    public void setYear(int year) { m_date.setYear(year); }
    
    public int getMonth() { return m_date.getMonth(); }
    
    public void setMonth(int month) { m_date.setMonth(month); }
    
    public int getDay() { return m_date.getDay(); }
    
    public void setDay(int day) { m_date.setDay(day); }
    
    public Date getDate() { return m_date.getDate(); }
    
    public void setDate(Date date) { m_date.setDate(date); }
    
}
